package com.glory.erp.invoice.goods.service.impl;

import java.io.Serializable;
import java.util.List;

import com.glory.erp.invoice.goods.service.GoodsService;
import com.glory.erp.invoice.goods.dao.GoodsDao;
import com.glory.erp.invoice.goods.bean.Goods;
import com.glory.erp.auth.base.BaseQueryModel;

public class GoodsServiceImpl implements GoodsService{
	
	private GoodsDao goodsDao;
	
	public void setGoodsDao(GoodsDao goodsDao) {
		this.goodsDao = goodsDao;
	}

	public void save(Goods goods) {
		// 设置商品的使用次数，在添加新商品时初始化为0
		goods.setUseNum(0);
		// 最大值和最小值没有设置
		goodsDao.save(goods);
	}

	public void update(Goods goods) {
		// 最大值和最小值没有设置
		goodsDao.update(goods);
	}

	public void delete(Goods goods) {
		goodsDao.delete(goods);
	}

	public Goods findById(Serializable uuid) {
		return goodsDao.findById(uuid);
	}

	public List<Goods> findAll() {
		return goodsDao.findAll();
	}

	public List<Goods> findAll(BaseQueryModel qm, Integer pageNum,Integer pageCount) {
		return goodsDao.findAll(qm,pageNum,pageCount);
	}

	public Integer getCount(BaseQueryModel qm) {
		return goodsDao.getCount(qm);
	}

	public List<Goods> findAllByGoodsType(Long uuid) {
		return goodsDao.findAllByGoodsType(uuid);
	}

	public void goodsUseNumUpdate() {
		goodsDao.goodsUseNumUpdate();
	}

	public List<Object[]> findWarnInfo() {
		return goodsDao.findWarnInfo();
	}
}